<?php
@session_start();

$con = mysqli_connect("127.0.0.1","root","","posts");

$name = $_SESSION['user'];
$query = "select * from posts";
$result=mysqli_query($con,$query);
$arr = mysqli_fetch_all($result);

$query = "select * from info where name = '$name'";
$result=mysqli_query($con,$query);
$one = mysqli_fetch_row($result);

echo json_encode("{'posts':".json_encode($arr).",'user':".json_encode($one)."}");
mysqli_close($con);


?>